Skip to content

Fix .NET package version props generation#1387

Merged
stephentoub merged 1 commit into
mainfrom
stephentoub/nuget-cli-version
May 22, 2026
Merged

Fix .NET package version props generation#1387
stephentoub merged 1 commit into
mainfrom
stephentoub/nuget-cli-version

Conversation

@stephentoub
Copy link
Copy Markdown
Collaborator

The .NET package should include GitHub.Copilot.SDK.props so consumers get CopilotCliVersion from the NuGet build assets. After the multi-targeting change, _GenerateVersionProps ran before Pack, which is too late for NuGet's _GetPackageFiles collection, causing the props file to be omitted.

This changes the generation hook to run before _GetPackageFiles so the generated props item is visible when NuGet builds the package.

Validated by packing with an isolated NuGet cache and checking the .nupkg contains build/GitHub.Copilot.SDK.props with the expected version.

Generate the Copilot CLI version props before NuGet collects package files so the generated props file is included in the packed build assets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@stephentoub stephentoub requested a review from a team as a code owner May 22, 2026 20:51
Copilot AI review requested due to automatic review settings May 22, 2026 20:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the .NET SDK project’s packaging pipeline so the generated GitHub.Copilot.SDK.props file (containing CopilotCliVersion) is included in the NuGet package build assets. This addresses the multi-targeting ordering issue where generating the props file before Pack was still too late for NuGet’s package file collection.

Changes:

  • Move _GenerateVersionProps execution earlier by running it before NuGet’s _GetPackageFiles target.
  • Ensure the dynamically generated build/GitHub.Copilot.SDK.props is visible to NuGet when it enumerates files to include in the .nupkg.
Show a summary per file
File Description
dotnet/src/GitHub.Copilot.SDK.csproj Adjusts target ordering so the generated .props file is included in the packed NuGet build assets.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@github-actions
Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR makes a .NET-specific MSBuild build infrastructure fix — changing the BeforeTargets from Pack to _GetPackageFiles to ensure the generated GitHub.Copilot.SDK.props file is included in the NuGet package correctly.

This change has no API surface impact and is specific to .NET's MSBuild/NuGet packaging pipeline. There are no equivalent concepts in the Node.js, Python, or Go SDKs that would need corresponding changes.

No cross-SDK consistency issues found.

Generated by SDK Consistency Review Agent for issue #1387 · ● 850.5K ·

@stephentoub stephentoub merged commit 4afa8ce into main May 22, 2026
31 checks passed
@stephentoub stephentoub deleted the stephentoub/nuget-cli-version branch May 22, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants